<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

// Code here is run before frontend controllers
class Public_Controller extends MY_Controller
{
	function Public_Controller()
	{
		parent::MY_Controller();
        $this->load->config('asset');
        $this->layout->_theme = config_item('default_themes');
        $this->get_meta_data();
	}

    function get_meta_data() {
        $this->load->model('meta_data_m');
        $this->meta_data_m->limit(3);
        $tmp = $this->meta_data_m->get_all();
        foreach($tmp as $k=>$v) {
            if($v->meta_tags == 'home_title')
                $this->data->page_title = $v->content;
            if($v->meta_tags == 'keywords')
                $this->layout->set_metadata('keywords', $v->content, 'meta');
            if($v->meta_tags == 'description')
                $this->layout->set_metadata('description', $v->content, 'meta');
        }
    }
}
